package com.meepo.basic.components.view

import com.meepo.basic.components.eventbus.EventBusManager
import com.meepo.sdk.component.view.activity.BaseSwipeBackActivity
import com.umeng.analytics.MobclickAgent

abstract class MeepoActivity : com.meepo.sdk.component.view.activity.BaseSwipeBackActivity() {

    override fun onResume() {
        super.onResume()
        MobclickAgent.onResume(this)

        if (enableEventBus()) EventBusManager.register(this)
    }

    override fun onPause() {
        super.onPause()
        MobclickAgent.onPause(this)
    }

    override fun onDestroy() {
        super.onDestroy()
        if (enableEventBus()) EventBusManager.unregister(this)

    }

//    override fun onStop() {
//        super.onStop()
//        if (enableEventBus()) EventBusManager.unregister(this)
//    }

    open fun enableEventBus(): Boolean = false
}